package com.example.productdataserviceprovider.service.city;


import com.example.productdataserviceprovider.service.AbstractService;

import java.util.Map;
import java.util.concurrent.CountDownLatch;
@Deprecated
public class LibraryThread extends AbstractService implements Runnable{
    private CountDownLatch latch;
    private LibraryService service;
    private Map<String,String> librarys;
    private String keyWords;
    private String resultFile;
    public LibraryThread(LibraryService service,Map<String,String> librarys,String keyWords,String resultFile,CountDownLatch latch){
        this.service=service;
        this.librarys=librarys;
        this.keyWords=keyWords;
        this.resultFile=resultFile;
        this.latch=latch;
    }
    public void run(){
        String[] keys=keyWords.split(",");
        for(String key:keys) {
            service.analysisLibrarys(librarys, key, resultFile);
        }
        latch.countDown();
        logger.info(Thread.currentThread().getName()+"======latch==="+latch.getCount());
    }

    public static void main(String[] args) {
        String keys="书籍/城市";
        keys=keys.replaceAll("\\/","");
        System.out.println(keys);
    }
}
